package cn.gcxy.util;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.springframework.web.multipart.MultipartFile;

public class UpFile {
	public static void upFile(MultipartFile file, String path) throws IOException {
		
		InputStream is;
		is = file.getInputStream();
		
		OutputStream os = new FileOutputStream(path);//myfile.txt");
		
		byte[] b = new byte[1024];
		int len = -1;
		while((len=is.read(b))!=-1) {
			os.write(b,0,len);
		}
		os.close();
		is.close();
	}
}
